package org.ycx.common.validator;

import com.baidu.unbiz.fluentvalidator.ValidationError;

import java.util.List;

/**
 * Created by 杨 on 2017-07-17.
 */
public class ValidationErrorToString {

    /**
     *
     * @param errors
     * @param sep 分隔符
     * @return
     */
    public static String errorToString(List<ValidationError> errors,String sep){
        StringBuilder sb = new StringBuilder();
        for (ValidationError err:errors) {
            sb.append(err.getErrorMsg());
            sb.append(sep);
        }
        return sb.toString();
    }
}
